package com.yanqu.road.server.cmd.activity.feast;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.cross.activity.CrossActivityProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.feast.CrossFeastMgr;
import com.yanqu.road.server.manager.activity.feast.activity.CrossFeastActivity;
import com.yanqu.road.server.protocol.CrossProtocol;

@Cmd(code = CrossProtocol.C_CROSS_SHAN_HE_FEAST_SEND_CHAT, desc = "聊天")
public class CrossFeastSendChatCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        CrossActivityProto.CrossActivityChatReqMsg reqMsg = CrossActivityProto.CrossActivityChatReqMsg.parseFrom(packet.getBytes());
        CrossFeastActivity activity = CrossFeastMgr.getActivity(reqMsg.getActivityId());
        activity.sendChatByCmd(packet.getPlayerId(), reqMsg.toBuilder());
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {

    }

    @Override
    public void sendData() {

    }
}
